home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 8197 < prev    next >
Encoding:
Text File  |  1996-08-05  |  1.7 KB  |  59 lines

  1. Path: anvil.ugrad.cs.ubc.ca!not-for-mail
  2. From: c2a192@ugrad.cs.ubc.ca (Kazimir Kylheku)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Newbie doesn't understand compiler error
  5. Date: 1 Mar 1996 18:42:53 -0800
  6. Organization: Computer Science, University of B.C., Vancouver, B.C., Canada
  7. Message-ID: <4h8cjdINNgnf@anvil.ugrad.cs.ubc.ca>
  8. References: <Pine.SUN.3.91.960301153010.11258B-100000@pioneer.uspto.gov>
  9. NNTP-Posting-Host: anvil.ugrad.cs.ubc.ca
  10.  
  11. In article <Pine.SUN.3.91.960301153010.11258B-100000@pioneer.uspto.gov>,
  12. Max Schubert  <schubert@pioneer.uspto.gov> wrote:
  13.  >I have just started to work with two different learning C books.  They 
  14.  >both have programs to copy and compile as I go along.  Twice I have 
  15.  >received this error from cc when attempting to compile two separate
  16.  >programs on SunOS 4.1.2:
  17.  >
  18.  >#include <stdio.h>
  19.  >
  20.  >void do_heading(char *filename);
  21.  >
  22.  >int line, page;
  23.  >
  24.  >main( int argv, char *argc[] )  <<- Compiler states "Syntax error at or near
  25.  >{                    word type char."
  26.  
  27. The SunOS cc compiler is not ANSI. It won't accept ANSI function parameter
  28. declarations. You have three choices: use unprotoize on your code, use GCC, or
  29. start coding ``old-style'':
  30.  
  31. int main(argv, argc)
  32. int argv;
  33. char **argc;
  34. {
  35.     /* and so forth    */
  36. }
  37.  
  38.  
  39.  
  40.  
  41.  >Do I need to update my compiler?
  42.  >
  43.  >    ANY help would be greatly appreciated.
  44.  >        
  45.  >                        Thanks,
  46.  >                            Max
  47.  >
  48.  >-------------------------------------------------------------------------------
  49.  >Max Schubert                           U.S. Patent and Trademark Office
  50.  >STAR Database Administrator                    schubert@uspto.gov or
  51.  >Scientific and Technical Information Center    schubert@pioneer.uspto.gov
  52.  >-------------------------------------------------------------------------------
  53.  >
  54.  >
  55.  
  56.  
  57. -- 
  58.  
  59.